#include "stdio.h"

int i = 0;
static int delay[5] = {12, 20, 40, 80, 160};

void test() 
{
    int past = get_ticks();
    sleep(delay[i % 5]);
    // sleep(delay[4]);
    printf("pid: %d; ", get_pid());
    printf("delay done, delay ticks: %d\n", get_ticks() - past);

    while (1) {
        ;
    }
}

int main()
{
    // pthread(test);
    // i++;
    int past = get_ticks();
    for (i = 0; i < 5; ++i) 
    {
        pthread(test);
        sleep(1);
    }
    printf("delay done, delay ticks: %d", get_ticks() - past);
    return 0;
}